<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html class="x-admin-sm">
    
    <head>
        <meta charset="UTF-8">
        <title>家政管理系统-V6.8</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="${pageContext.request.contextPath}/static/branch_oa/css/font.css">
        <link rel="stylesheet" href="${pageContext.request.contextPath}/static/branch_oa/css/xadmin.css">
        <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
        <script type="text/javascript" src="${pageContext.request.contextPath}/static/branch_oa/lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="${pageContext.request.contextPath}/static/branch_oa/js/xadmin.js"></script>
        <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
        <!--[if lt IE 9]>
            <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
            <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
        <style type="text/css">
            .inline .layui-form-item{
                  display: inline-block;
            }
            .inline .layui-form-item label{
                  width: auto;
            }

            .inline .layui-form-item .layui-input-inline{
                  width: 60px;
            }
            .right_img{
                position: absolute;
                top: 0px;
                right: 0px;
                padding: 7px 0px;
                background: #ccc;
            }
            #popup{
                display: none;
                width:600px;
                height:400px;
                position: fixed;
                top: 42%;
                left:50%;
                margin-top: -200px;
                margin-left: -300px;
            }
            .close_btn{
                float: right;
            }

        </style>
        <%--<script>
            function isExistone(staffname){

                $.ajax({
                    type: "GET",
                    url: "${pageContext.request.contextPath}/sta/getStaffCard?staffname="+staffname,
                    dataType: "json",
                    success: function(data){
                        if(data.result==1){
                            $('#ShowStaffName').html('<font color=green>员工1:该员工存在！</font>');
//                  document.getElementById("checkResult").innerHTML="<font color=red>用户已经存在请重新输入！</font>";
                        }else if(data.result == 0){
//                  document.getElementById("checkResult").innerHTML="<font color=green>用户可以使用！</font>";
                            $('#ShowStaffName').html('<font color=red>员工1:该员工不存在！</font>');
                        }
                    }
                });
            }
        </script>
        <script>
            function isExisttwo(staffname){

                $.ajax({
                    type: "GET",
                    url: "${pageContext.request.contextPath}/sta/getStaffCard?staffname="+staffname,
                    dataType: "json",
                    success: function(data){
                        if(data.result==1){
                            $('#ShowStaffName').html('<font color=green>员工2:该员工存在！</font>');
//                  document.getElementById("checkResult").innerHTML="<font color=red>用户已经存在请重新输入！</font>";
                        }else if(data.result == 0){
//                  document.getElementById("checkResult").innerHTML="<font color=green>用户可以使用！</font>";
                            $('#ShowStaffName').html('<font color=red>员工2:该员工不存在！</font>');
                        }
                    }
                });
            }
        </script>
        <script>
            function isExistthree(staffname){

                $.ajax({
                    type: "GET",
                    url: "${pageContext.request.contextPath}/sta/getStaffCard?staffname="+staffname,
                    dataType: "json",
                    success: function(data){
                        if(data.result==1){
                            $('#ShowStaffName').html('<font color=green>员工3:该员工存在！</font>');
//                  document.getElementById("checkResult").innerHTML="<font color=red>用户已经存在请重新输入！</font>";
                        }else if(data.result == 0){
//                  document.getElementById("checkResult").innerHTML="<font color=green>用户可以使用！</font>";
                            $('#ShowStaffName').html('<font color=red>员工3:该员工不存在！</font>');
                        }
                    }
                });
            }
        </script>
        <script>
            function isExistfour(staffname){

                $.ajax({
                    type: "GET",
                    url: "${pageContext.request.contextPath}/sta/getStaffCard?staffname="+staffname,
                    dataType: "json",
                    success: function(data){
                        if(data.result==1){
                            $('#ShowStaffName').html('<font color=green>员工4:该员工存在！</font>');
//                  document.getElementById("checkResult").innerHTML="<font color=red>用户已经存在请重新输入！</font>";
                        }else if(data.result == 0){
//                  document.getElementById("checkResult").innerHTML="<font color=green>用户可以使用！</font>";
                            $('#ShowStaffName').html('<font color=red>员工4:该员工不存在！</font>');
                        }
                    }
                });
            }
        </script>
        <script>
            function isExistfive(staffname){

                $.ajax({
                    type: "GET",
                    url: "${pageContext.request.contextPath}/sta/getStaffCard?staffname="+staffname,
                    dataType: "json",
                    success: function(data){
                        if(data.result==1){
                            $('#ShowStaffName').html('<font color=green>员工5:该员工存在！</font>');
//                  document.getElementById("checkResult").innerHTML="<font color=red>用户已经存在请重新输入！</font>";
                        }else if(data.result == 0){
//                  document.getElementById("checkResult").innerHTML="<font color=green>用户可以使用！</font>";
                            $('#ShowStaffName').html('<font color=red>员工5:该员工不存在！</font>');
                        }
                    }
                });
            }
        </script>--%>

    </head>
    <body>
        <div class="layui-fluid">
            <div class="layui-row">
                <form class="layui-form">
                    <input type="hidden" id="states" value="${settlements.settlestate}">
                    <input type="hidden" name="id" value="${settlements.id}">
                  <div class="layui-form-item">
                      <label class="layui-form-label" style="color:#009688;">
                             工时结算
                      </label>
                  </div>
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="num" class="layui-form-label">
                          派单工号
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="num" name="ordersid"  value="${settlements.ordersid}" readonly="readonly"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="type" class="layui-form-label">
                          服务类型
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="type" name="serviceclass"  value="${settlements.serviceclass}" readonly="readonly"
                                 autocomplete="off" class="layui-input">
                          </div>
                         <%-- <div class="layui-input-inline">
                          <select id="type" name="type" class="valid">
                              <option value="" >${settlements.serviceclass}</option>
                              <c:forEach items="${serviceClassupSe}" var="serviceClassupSes">
                                 <option value="${serviceClassupSes.busclass}">${serviceClassupSes.busclass}</option>
                              </c:forEach>
                          </select>
                      </div>--%>
                  </div>
                  
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="cardid" class="layui-form-label">
                          卡号                    
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="cardid" name="cardid"  value="${settlements.cardid}" readonly="readonly"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>
                    <div class="layui-form-item" style="display: inline-block;">
                        <label for="cardid" class="layui-form-label">
                            姓名
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" id="cname" name="cname"  value="${settlements.cname}" readonly="readonly"
                                   autocomplete="off" class="layui-input">
                        </div>
                    </div>
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="service_time" class="layui-form-label">
                            服务时间                  
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="service_time" name="servicetime" disabled="disabled"
                                 value='<fmt:formatDate value="${settlements.servicetime}" pattern="yyyy-MM-dd" />'
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>
                 <%-- <div class="layui-form-item" style="display: inline-block;">
                      <label for="reckoner" class="layui-form-label">
                            结算人                  
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="reckoner" name="settlementpeople"   value="${settlements.settlementpeople}"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>--%>
                 <%-- <div class="layui-form-item" style="display: inline-block;">
                      <label for="settler_time" class="layui-form-label">
                            结算时间                  
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="settler_time" name="settlementtime"
                                 value='<fmt:formatDate value="${settlements.settlementtime}" pattern="yyyy-MM-dd" />'
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>--%>
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="settlestate" class="layui-form-label">
                            结算状态                  
                      </label>
                      <div class="layui-input-inline">
                          <select id="settlestate" name="settlestate" class="valid">
                                <option value="${settlements.settlestate}" selected>${settlements.settlestate}</option>
                              <%--  <option value="未结算">未结算</option>--%><%--已结算--%>
                                <option value="已结算">已结算</option><%--已结算--%>
                                <option value="作废">作废</option><%--作废--%>
                          </select>
                      </div>
                  </div>
                  <%--<div class="layui-form-item">
                      <label class="layui-form-label" style="color:#009688;">
                             结算
                      </label>
                  </div>
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="name" class="layui-form-label">
                          交票人
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="name" name="submitpeople"   value="${settlements.submitpeople}"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="submithourses" class="layui-form-label">
                          结算工时/现金
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="submithourses" name="submithourse"   value="${settlements.submithourse}"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>
                  
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="staff" class="layui-form-label">
                          派单工作人员                     
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="staff" name="ordersname"  value="${settlements.ordersname}"
                                 autocomplete="off" class="layui-input">
                      </div>
                  </div>--%>

                  <div class="layui-form-item">
                      <label class="layui-form-label" style="color:#009688;">
                             人员工时分配
                      </label>
                      <span id="ShowStaffName"></span>
                  </div>
                   <%-- <c:if test="${settlements.snameone != null && settlements.snameone != '' }">
                        value=" ${settlements.snameone}"
                    </c:if>
                    <c:if test="${sessionScope.sname != ''}">
                        value="${sessionScope.sname}"
                    </c:if>--%>

        <div class="layui-row  inline">
                <div class="layui-form-item">
                            <label for="userone" class="layui-form-label" style="width: 80px;">
                                工作人员1
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="userone" name="snameone" value="${settlements.snameone}" onblur="isExistone(this.value)"
                                autocomplete="off" class="layui-input">
<%--                                <a title="选择"  onclick="xadmin.open('选择','${pageContext.request.contextPath}/sta/findStaffByBstoreidSettle?bssign=${bsadmin1.bsid}')" href="javascript:;" class="right_img"><i class="iconfont">&#xe6a7;</i></a>--%>
                                <a title="选择"  onclick="testS(${bsadmin1.bsid},'userone')" href="javascript:;" class="right_img"><i class="iconfont">&#xe6a7;</i></a>
                            </div>
                        </div>
                      <%--  <div class="layui-form-item">
                            <label for="userone" class="layui-form-label" style="width: 80px;">
                                工作人员1
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="userone" name="snameone" required="" lay-verify="user1" value="${settlements.snameone}"
                                       autocomplete="off" class="layui-input">
                                <a title="选择"  onclick="xadmin.open('选择','${pageContext.request.contextPath}/')" href="javascript:;" class="right_img"><i class="iconfont">&#xe6a7;</i></a>
                                &lt;%&ndash;<a title="选择" href="javascript:;" class="right_img choice_btn"><i class="iconfont">&#xe6a7;</i></a>&ndash;%&gt;
                            </div>
                        </div>--%>

                        <div class="layui-form-item">
                            <label for="shourseone" class="layui-form-label">
                                小时数/现金数
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="shourseone" name="shourseone"   value="${settlements.shourseone}"
                                autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="spread1" class="layui-form-label">
                                宣传
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="spread1" name="propagandaone"   value="${settlements.propagandaone}"
                                autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="room1" class="layui-form-label">
                                空房                     
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="room1" name="vacantroomone"   value="${settlements.vacantroomone}"
                                autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="royalty1" class="layui-form-label">
                                提成                     
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="royalty1" name="commissionone"  value="${settlements.commissionone}"
                                autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="bonus1" class="layui-form-label">
                                奖金                     
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="bonus1" name="bonusone"   value="${settlements.bonusone}"
                                autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="deduc" class="layui-form-label">
                                扣除                     
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="deduc" name="deductionone"   value="${settlements.deductionone}"
                                autocomplete="off" class="layui-input">
                            </div>
                        </div>
                  </div>
                    <div class="layui-row  inline">
                        <div class="layui-form-item">
                            <label for="usertwo" class="layui-form-label" style="width: 80px;">
                                工作人员2
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="usertwo" name="snametwo"  value="${settlements.snametwo}" onblur="isExisttwo(this.value)"
                                       autocomplete="off" class="layui-input">
                                <%--<a title="选择"  onclick="xadmin.open('选择','${pageContext.request.contextPath}/Set/jumpSliist')" href="javascript:;" class="right_img"><i class="iconfont">&#xe6a7;</i></a>--%>
                                <a title="选择"  onclick="testS(${bsadmin1.bsid},'usertwo')" href="javascript:;" class="right_img"><i class="iconfont">&#xe6a7;</i></a>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="shoursetwo" class="layui-form-label">
                                小时数/现金数
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="shoursetwo" name="shoursetwo"   value="${settlements.shoursetwo}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="spread1" class="layui-form-label">
                                宣传
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="spread12" name="propagandatwo"  value="${settlements.propagandatwo}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="room1" class="layui-form-label">
                                空房
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="room12" name="vacantroomtwo"   value="${settlements.vacantroomtwo}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="royalty1" class="layui-form-label">
                                提成
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="royalty12" name="commissiontwo"   value="${settlements.commissiontwo}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="bonus1" class="layui-form-label">
                                奖金
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="bonus12" name="bonustwo"  value="${settlements.bonustwo}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="deduc" class="layui-form-label">
                                扣除
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="deduc2" name="deductiontwo"   value="${settlements.deductiontwo}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row  inline">
                        <div class="layui-form-item">
                            <label for="userthree" class="layui-form-label" style="width: 80px;">
                                工作人员3
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="userthree" name="snamethree"  value="${settlements.snamethree}" onblur="isExistthree(this.value)"
                                       autocomplete="off" class="layui-input">
                               <%-- <a title="选择"  onclick="xadmin.open('选择','${pageContext.request.contextPath}/Set/jumpSliist')" href="javascript:;" class="right_img"><i class="iconfont">&#xe6a7;</i></a>--%>
                                <a title="选择"  onclick="testS(${bsadmin1.bsid},'userthree')" href="javascript:;" class="right_img"><i class="iconfont">&#xe6a7;</i></a>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="shoursethree" class="layui-form-label">
                                小时数/现金数
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="shoursethree" name="shoursethree"   value="${settlements.shoursethree}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="spread1" class="layui-form-label">
                                宣传
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="spread13" name="propagandathree"  value="${settlements.propagandathree}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="room1" class="layui-form-label">
                                空房
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="room13" name="vacantroomthree"   value="${settlements.vacantroomthree}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="royalty1" class="layui-form-label">
                                提成
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="royalty31" name="commissionthree"   value="${settlements.commissionthree}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="bonus1" class="layui-form-label">
                                奖金
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="bonus13" name="bonusthree"  value="${settlements.bonusthree}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="deduc" class="layui-form-label">
                                扣除
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="deduc3" name="deductionthree"   value="${settlements.deductionthree}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row  inline">
                        <div class="layui-form-item">
                            <label for="snamefour" class="layui-form-label" style="width: 80px;">
                                工作人员4
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="snamefour" name="snamefour"  value="${settlements.snamefour}" onblur="isExistfour(this.value)"
                                       autocomplete="off" class="layui-input">
                                <%--<a title="选择"  onclick="xadmin.open('选择','${pageContext.request.contextPath}/Set/jumpSliist')" href="javascript:;" class="right_img"><i class="iconfont">&#xe6a7;</i></a>--%>
                                <a title="选择"  onclick="testS(${bsadmin1.bsid},'snamefour')" href="javascript:;" class="right_img"><i class="iconfont">&#xe6a7;</i></a>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="shoursefour" class="layui-form-label">
                                小时数/现金数
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="shoursefour" name="shoursefour"  value="${settlements.shoursefour}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="spread1" class="layui-form-label">
                                宣传
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="spread14" name="propagandafour" value="${settlements.propagandafour}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="room1" class="layui-form-label">
                                空房
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="room14" name="vacantroomfour"  value="${settlements.vacantroomfour}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="royalty1" class="layui-form-label">
                                提成
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="royalty41" name="commissionfour"  value="${settlements.commissionfour}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="bonus1" class="layui-form-label">
                                奖金
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="bonus14" name="bonusfour"   value="${settlements.bonusfour}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="deduc" class="layui-form-label">
                                扣除
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="deduc4" name="deductionfour"  value="${settlements.deductionfour}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row  inline">
                        <div class="layui-form-item">
                            <label for="userfive" class="layui-form-label" style="width: 80px;">
                                工作人员5
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="userfive" name="snamefive" value="${settlements.snamefive}" onblur="isExistfive(this.value)"
                                       autocomplete="off" class="layui-input">
                                <%--<a title="选择"  onclick="xadmin.open('选择','${pageContext.request.contextPath}/Set/jumpSliist')" href="javascript:;" class="right_img"><i class="iconfont">&#xe6a7;</i></a>--%>
                                <a title="选择"  onclick="testS(${bsadmin1.bsid},'userfive')" href="javascript:;" class="right_img"><i class="iconfont">&#xe6a7;</i></a>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="shoursefive" class="layui-form-label">
                                小时数/现金数
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="shoursefive" name="shoursefive"   value="${settlements.shoursefive}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="spread1" class="layui-form-label">
                                宣传
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="spread2" name="propagandafive"   value="${settlements.propagandafive}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="room1" class="layui-form-label">
                                空房
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="room5" name="vacantroomfive"  value="${settlements.vacantroomfive}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="royalty1" class="layui-form-label">
                                提成
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="royalty5" name="commissionfive"  value="${settlements.commissionfive}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="bonus1" class="layui-form-label">
                                奖金
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="bonus5" name="bonusfive"   value="${settlements.bonusfive}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="deduc" class="layui-form-label">
                                扣除
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="deduc5" name="deductionfive"   value="${settlements.deductionfive}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                    </div>
                  <div class="layui-form-item">
                      <label class="layui-form-label" style="color:#009688;">
                             会员卡扣除
                      </label>
                  </div>
                  <div class="layui-row  inline">
                        <div class="layui-form-item">
                            <label for="card1" class="layui-form-label" style="width: 80px;">
                                会员卡1
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="card1" name="membershipcard"  value="${settlements.membershipcard}"
                                autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="hourseormoneys" class="layui-form-label">
                                小时数/现金数
                            </label>
                            <div class="layui-input-inline">
                                <input type="text" id="hourseormoneys" name="hourseormoney"  value="${settlements.hourseormoney}"
                                autocomplete="off" class="layui-input">
                            </div>
                        </div>
                  </div>
                  <div class="layui-form-item layui-form-text">
                      <label for="sremarks" class="layui-form-label">结算备注</label>
                      <div class="layui-input-block">
                          <textarea placeholder="" id="sremarks" name="settlementremark" class="layui-textarea" >${settlements.settlementremark}</textarea>
                      </div>
                  </div>
                  <div class="layui-form-item">
                      <label class="layui-form-label" style="color:#009688;">
                             未结算
                      </label>
                  </div>
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="presenter" class="layui-form-label">
                         交单人
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="presenter" name="onpeople"   value="${settlements.onpeople}"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="onhourseoronmoneys" class="layui-form-label">
                          应收工时/现金
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="onhourseoronmoneys" name="onhourseoronmoney"    value="${settlements.onhourseoronmoney}"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>

                    <div class="layui-form-item" style="display: inline-block;">
                        <label for="agreetime" class="layui-form-label">
                            结算日期
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" id="agreetime" name="appointmenttime"
                                   value='<fmt:formatDate value="${settlements.appointmenttime}" pattern="yyyy-MM-dd" />'
                                   autocomplete="off" class="layui-input">
                        </div>
                    </div>
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="matter" class="layui-form-label">
                          结算事项
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="matter" name="appointmentthing" value="${settlements.appointmentthing}"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>
                  <div class="layui-form-item">
                      <label class="layui-form-label" style="color:#009688;">
                             作废处理
                      </label>
                  </div>
                  <div class="layui-form-item layui-form-text">
                      <label for="desc" class="layui-form-label">作废原因</label>
                      <div class="layui-input-block">
                          <textarea placeholder="" id="desc" name="tovoid" class="layui-textarea" >${settlements.tovoid}</textarea>
                      </div>
                  </div>
                  <div class="layui-form-item">
                      <label for="L_repass" class="layui-form-label">
                      </label>
                      <button  class="layui-btn" lay-filter="add" lay-submit="" id="L_repass">
                          结算
                      </button>
                  </div>
              </form>
            </div>
        </div>
        <%--<div id="popup">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <form class="layui-form layui-col-space5" action="${pageContext.request.contextPath}/sta/findAllStaffById" style="display: inline-block;" >
                        <div class="layui-inline layui-show-xs-block">
                            <input type="text" name="username"  placeholder="请输入姓名" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <input type="text" name="card"  placeholder="请输入员工号" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
                        </div>
                    </form>
                    <a href="javascript:;" class="close_btn"><i class="iconfont">&#xe69a;</i></a></a>
                </div>--%>
                <%--<div id="staffS" class="layui-card-body ">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>工号</th>
                            <th>姓名</th>
                            <th>操作</th>
                        </thead>
                        <tbody>--%>
                       <%-- <c:if test="${staffListSettleStaff.data == null }">
                            <c:forEach items="${staffList.data}" var="staff" varStatus="abc">
                                <tr>
                                    <td>${abc.index+1}</td>
                                    <td>${staff.card}</td>
                                    <td>${staff.staffname}</td>
                                    <td class="td-manage">
                                        <a title="选择" href="javascript:;" class="layui-btn layui-btn layui-btn-xs" onclick="member_choice(this,'112')">
                                            选择
                                        </a>
                                    </td>
                                </tr>
                            </c:forEach>
                       <%-- </c:if>--%>
                        <%--<c:if test="${staffListSettleStaff.data != null }">
                            <c:forEach items="${staffListSettleStaff.data}" var="staffs" varStatus="abcd">
                                <tr>
                                    <td>${abcd.index+1}</td>
                                    <td>${staffs.card}</td>
                                    <td>${staffs.staffname}</td>
                                    <td class="td-manage">
                                        <a title="选择" href="javascript:;" class="layui-btn layui-btn layui-btn-xs" onclick="member_choice(this,'112')">
                                            选择
                                        </a>
                                    </td>
                                </tr>
                            </c:forEach>
                        </c:if>
                        </tbody>
                    </table>
                </div>--%>
                <div class="layui-card-body ">
                    <div class="page">
                        <div>
                            <c:if test="${staffListSettle.pageNum > 1}">
                                <a class="prev" href="${pageContext.request.contextPath}/sta/findAllStaffById?pageNum=${staffListSettle.pageNum-1}">&lt;&lt;</a>
                            </c:if>
                            <c:if test="${staffListSettle.pageNum == 1}">
                                <a class="prev" href="">&lt;&lt;</a>
                            </c:if>

                            <c:forEach var="i" begin="${staffListSettle.start}" end="${staffListSettle.end}">
                                <c:if test="${staffListSettle.pageNum == i}">
                                    <span class="current" href="${pageContext.request.contextPath}/sta/findAllStaffById?pageNum=${i}">${i}</span>
                                </c:if>
                                <c:if test="${staffListSettle.pageNum != i}">
                                    <a class="num" href="${pageContext.request.contextPath}/sta/findAllStaffById?pageNum=${i}">${i}</a>
                                </c:if>
                            </c:forEach>

                            <c:if test="${staffListSettle.pageNum < staffListSettle.totalPage}">
                                <a class="prev" href="${pageContext.request.contextPath}/sta/findAllStaffById?pageNum=${staffListSettle.pageNum+1}">>></a>
                            </c:if>
                            <c:if test="${staffListSettle.pageNum == staffListSettle.totalPage}">
                                <a class="prev" href="">>></a>
                            </c:if>

                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script type="text/javascript" src="${pageContext.request.contextPath}/static/branch_oa/js/xcity.js"></script>

        <script>
           /* $(".choice_btn").click(function(){

                $("#popup").show(
                    function () {
                        $.ajax({
                            method: "GET",
                            url:"${pageContext.request.contextPath}/sta/findStaffByBstoreid?bssign=${bsadmin1.bsid}",
                            contentType:"application/json",
                            success(data){

                                alert("查询员工成功")
                           }
                        });

                    }
                );

            })

            $(".close_btn").click(function(){

                $("#popup").hide();

            })*/


            layui.use(['laydate','form'], function(){
        var laydate = layui.laydate;
        var form = layui.form;

        //执行一个laydate实例
        laydate.render({
          elem: '#service_time' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
          elem: '#settler_time' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
          elem: '#agreetime' //指定元素
        });

            //执行一个laydate实例
            laydate.render({
                elem: '#ceshitime' //指定元素
            });


      });
       
        layui.use(['form', 'layer'],

            
            function() {
                $ = layui.jquery;
                var form = layui.form,
                layer = layui.layer;


                //监听提交
                form.on('submit(add)',
                    function(data) {
                        console.log(data.field)
                      if(${settlements.cardid != null } ){
                          var onhourseoronmoneys = $("#onhourseoronmoneys").val();/*应收工时/现金*/
                          var hourseormoneys = $("#hourseormoneys").val();  /*会员卡扣除工时/现金*/
                          var shourseone = $("#shourseone").val();
                          var shoursetwo = $("#shoursetwo").val();
                          var shoursethree = $("#shoursethree").val();
                          var shoursefour = $("#shoursefour").val();
                          var shoursefive = $("#shoursefive").val();
                          var shoursesum = shourseone*1+shoursetwo*1+shoursethree*1+shoursefour*1+shoursefive*1;
                          var settlestate = $("#settlestate").val();  /*页面结算状态*/
                          var state = $("#states").val();   /*数据库结算状态*/


                          if(settlestate=="未结算" && state=="未结算" ){
                              alert("该单状态为未结算，请去结算或作废处理")
                          }else if(settlestate=="未结算" && state=="已结算"){
                              alert("当前派单已结算")
                          } else if(settlestate=="未结算" && state=="作废"){
                              alert("当前派单已作废")
                          } else if(settlestate=="已结算" && state=="未结算"){
                              if( hourseormoneys == shoursesum && hourseormoneys == onhourseoronmoneys){
                                  $.ajax({
                                      method: "POST",
                                      url: "${pageContext.request.contextPath}/Set/updateSettlement",
                                      data:data.field,
                                      success: function (res) {
                                          if(res){
                                              layer.alert("结算成功 ", {
                                                  icon: 6
                                              }, function() {
                                                  //关闭当前frame
                                                  xadmin.close();
                                                  // 可以对父窗口进行刷新
                                                  xadmin.father_reload();
                                              });
                                          }else{
                                              layer.alert("结算失败，请验证当前结算状态,或查看当前卡余额", {
                                                  icon: 5
                                              }, function() {
                                                  //关闭当前frame
                                                  xadmin.close();
                                                  // 可以对父窗口进行刷新
                                                  xadmin.father_reload();
                                              });
                                          }
                                      }
                                  });
                              }else if ( onhourseoronmoneys != hourseormoneys != shoursesum){
                                  alert("人员工时分配工时/现金--会员卡扣除工时/现金--应收工时/现金--必须一致，请重新输入");
                              }

                          }else if(settlestate=="已结算" && state=="已结算"){
                              alert("当前派单已结算")
                          }else if(settlestate=="已结算" && state=="作废"){
                              alert("当前派单已作废")
                          }else if(settlestate=="作废" && state=="未结算"){
                              $.ajax({
                                  method: "POST",
                                  url: "${pageContext.request.contextPath}/Set/updateSettlement",
                                  data:data.field,
                                  success: function (res) {
                                      if(res){
                                          layer.alert("成功作废 ", {
                                              icon: 6
                                          }, function() {
                                              //关闭当前frame
                                              xadmin.close();
                                              // 可以对父窗口进行刷新
                                              xadmin.father_reload();
                                          });
                                      }else{
                                          layer.alert("结算失败，请验证当前结算状态", {
                                              icon: 5
                                          }, function() {
                                              //关闭当前frame
                                              xadmin.close();
                                              // 可以对父窗口进行刷新
                                              xadmin.father_reload();
                                          });
                                      }
                                  }
                              });
                          }else if(settlestate=="作废" && state=="已结算"){
                              $.ajax({
                                  method: "POST",
                                  url: "${pageContext.request.contextPath}/Set/updateSettlement",
                                  data:data.field,
                                  success: function (res) {
                                      if(res){
                                          layer.alert("成功作废 ", {
                                              icon: 6
                                          }, function() {
                                              //关闭当前frame
                                              xadmin.close();
                                              // 可以对父窗口进行刷新
                                              xadmin.father_reload();
                                          });
                                      }else{
                                          layer.alert("结算失败，请验证当前结算状态", {
                                              icon: 5
                                          }, function() {
                                              //关闭当前frame
                                              xadmin.close();
                                              // 可以对父窗口进行刷新
                                              xadmin.father_reload();
                                          });
                                      }
                                  }
                              });
                          }else if(settlestate=="作废" && state=="已结算"){
                              alert("当前派单已作废")
                          }

                      }else {
                          //******************************************************************************************************
                          var settlestate = $("#settlestate").val();  /*页面结算状态*/
                          var state = $("#states").val();   /*数据库结算状态*/
                          if(settlestate=="未结算" && state=="未结算" ){
                              alert("该单状态为未结算，请去结算或作废处理")
                          }else if(settlestate=="未结算" && state=="已结算"){
                              alert("当前派单已结算")
                          } else if(settlestate=="未结算" && state=="作废"){
                              alert("当前派单已作废")
                          } else if(settlestate=="已结算" && state=="未结算"){

                                  $.ajax({
                                      method: "POST",
                                      url: "${pageContext.request.contextPath}/Set/updateSettlement",
                                      data:data.field,
                                      success: function (res) {
                                          if(res){
                                              layer.alert("结算成功 ", {
                                                  icon: 6
                                              }, function() {
                                                  //关闭当前frame
                                                  xadmin.close();
                                                  // 可以对父窗口进行刷新
                                                  xadmin.father_reload();
                                              });
                                          }else{
                                              layer.alert("结算失败，请验证当前结算状态", {
                                                  icon: 5
                                              }, function() {
                                                  //关闭当前frame
                                                  xadmin.close();
                                                  // 可以对父窗口进行刷新
                                                  xadmin.father_reload();
                                              });
                                          }
                                      }
                                  });


                          }else if(settlestate=="已结算" && state=="已结算"){
                              alert("当前派单已结算")
                          }else if(settlestate=="已结算" && state=="作废"){
                              alert("当前派单已作废")
                          }else if(settlestate=="作废" && state=="未结算"){
                              $.ajax({
                                  method: "POST",
                                  url: "${pageContext.request.contextPath}/Set/updateSettlement",
                                  data:data.field,
                                  success: function (res) {
                                      if(res){
                                          layer.alert("成功作废 ", {
                                              icon: 6
                                          }, function() {
                                              //关闭当前frame
                                              xadmin.close();
                                              // 可以对父窗口进行刷新
                                              xadmin.father_reload();
                                          });
                                      }else{
                                          layer.alert("结算失败，请验证当前结算状态", {
                                              icon: 5
                                          }, function() {
                                              //关闭当前frame
                                              xadmin.close();
                                              // 可以对父窗口进行刷新
                                              xadmin.father_reload();
                                          });
                                      }
                                  }
                              });
                          }else if(settlestate=="作废" && state=="已结算"){
                              $.ajax({
                                  method: "POST",
                                  url: "${pageContext.request.contextPath}/Set/updateSettlement",
                                  data:data.field,
                                  success: function (res) {
                                      if(res){
                                          layer.alert("成功作废 ", {
                                              icon: 6
                                          }, function() {
                                              //关闭当前frame
                                              xadmin.close();
                                              // 可以对父窗口进行刷新
                                              xadmin.father_reload();
                                          });
                                      }else{
                                          layer.alert("结算失败，请验证当前结算状态", {
                                              icon: 5
                                          }, function() {
                                              //关闭当前frame
                                              xadmin.close();
                                              // 可以对父窗口进行刷新
                                              xadmin.father_reload();
                                          });
                                      }
                                  }
                              });
                          }else if(settlestate=="作废" && state=="已结算"){
                              alert("当前派单已作废")
                          }

                      }

                        return false;
                    });


            });</script>
        <script>var _hmt = _hmt || []; (function() {
                var hm = document.createElement("script");
                hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
                var s = document.getElementsByTagName("script")[0];
                s.parentNode.insertBefore(hm, s);
            })();</script>
    </body>
    <script>
        function testS(id,val) {
           var mylay = layer.open({
                type: 2,
                area:["950px","480px"],
                title: "详细设置 ",
                content: '${pageContext.request.contextPath}/sta/findStaffByBstoreidSettle?bssign='+id,
               btn:["保存","返回"],
                yes:function(index, layero){
                    var body = layer.getChildFrame('body', index);
                    var test1 = body.find("#test1").val();
                    $("#"+val+"").val(test1);
                    layer.close(mylay);
                }
            });
        }
        
    </script>
</html>
